import request from '@/utils/request'

export function addPurchase(data) {
  return request({
    url: '/purchase',
    method: 'post',
    data
  })
}

export function getPurchaseList(params) {
  return request({
    url: '/purchase',
    method: 'get',
    params
  })
}

export function getPurchaseInfo(id) {
  return request({
    url: '/purchase',
    method: 'get',
    params: {
      id: id
    }
  })
}

export function modifyPurchase(id, data) {
  return request({
    url: '/purchase',
    method: 'put',
    data,
    params: {
      id: id
    }
  })
}

export function getBuyerList() {
  return request({
    url: '/buyer',
    method: 'get'
  })
}

export function delPurchase(id) {
  return request({
    url: '/purchase',
    method: 'delete',
    params: {
      id: id
    }
  })
}

